<?php
session_start();
$_SESSION['hashTag']=0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>	
	    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	    <meta name="title" content="SenTaNa">
		<meta name="description" content="Sentana, Sentiment search engine">
     
		<link rel="stylesheet" type="text/css" href="design_files/main.css">
		<style type="text/css">
			#footer { bottom: 0; position: fixed; }
			#message { margin: 14px 0 0 5px; }
		</style>
		
		<title>SenTanA</title>
		

	<style type="text/css">
	body {
	background-color: #000000;
}
    </style>
    	<link type="text/css" rel="stylesheet" href="http://freebaselibs.com/static/suggest/1.3/suggest.min.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://freebaselibs.com/static/suggest/1.3/suggest.min.js"></script>
<script type="text/javascript">
$(function() 
{
	$("#brand_input")
	.suggest({all_types:true})
	.bind("fb-select", function(e, data) {  $('#idOfKeyword').val(data.id);})
});
      
function clickClear(thisfield)
{
	thisfield.value = "";
}


</script>
</script>
</head>
			
	<body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">	
	
	<div id="contentHolder">
		<div id="topLink">
			<ul>
				<li><a href="faq.php">FAQ</a></li> |
				<li><a href="contactus.php">Contact Us</a></li> |
				<li><a href="about.php">About</a></li>
		  </ul>
		
		</div>
			<div>
	  <h1 id="logo"><a href="index.php"><img src="design_files/logo.png"></a></h1>	
		  <form action="prepareSearchGraphs.php" name="brand_input_form" id="brand_input_form" method="post">
	    <p>	  
								  <input type="text" name="txtSearch" onclick="clickClear(this)" class="brand_input" id="brand_input" value="what would you like to search for?" maxlength="50"> 
								  <label>
								    <input type="image" name="btnSearch" id="btnSearch" src="design_files/search_button_text.gif" type="submit"/>
		    </label>
	    <input type="hidden" id="idOfKeyword" name="idOfKeyword" value="" />
        </p>
	  </form>
      
      </div>
      <div style="background-color:#FFFFFF">
      <table align="center" border="0" width="100%" bgcolor="#000000"><tr><td> 
       <table align="center" border="0" width="500">
           <tr><td colspan="2" align="center"><p><font face="Trebuchet MS, Arial, Helvetica, sans-serif" color="white" size="+3"><?php echo $_SESSION['txtSearch'];?> is <?php echo $_SESSION['keywordType'];?></font></p></td></tr>
               <?php
			   if($_GET['sendReport']==1)
			   {
				   $mail=$_POST['email'];
				   //MAIL İÇİN NE YAPILACAKSA BURDA YAP
				   echo "<tr><td align='center'><p><font face='verdana' color='white' size='4'>Thank You for your interest! <br><br>We are going to send the report to your email when its ready...</font></p><br><br><br><font face='verdana' color='gray' size='4'> SenTanA TEAM</font></td></tr>";
			   }
			   else if($_SESSION['sentimentAvailable']==1)
			   {
				   echo " <tr><td  width='10%' align='center'><img src='design_files/smiley1.png' />
              <font face='Trebuchet MS, Arial, Helvetica, sans-serif' color='white'>".round($_SESSION['positive']/($_SESSION['positive']+$_SESSION['negative'])*100)."%</font>
               <img src='design_files/smiley2.png' />
              <font face='Trebuchet MS, Arial, Helvetica, sans-serif' color='white'>".round($_SESSION['negative']/($_SESSION['positive']+$_SESSION['negative'])*100)."%</font>									</td></tr></table>
				<!-- boşluk için  <div id=spacer></div>
				<br class=clearBoth>-->
				
                <div align='center' id='contentHolder'>
                <table align='center' border='0' colspan='2'>
               
                <tr><td colspan='2' align='center' width='500'><img src='reports/".$_SESSION['userId']."g1.png'"."/></td></tr>
                 <tr><td colspan='2' align='center'><img src='reports/".$_SESSION['userId']."g2.png'/></td></tr>
				  <tr><td colspan='2' align='center' width='500'><p><font face='Trebuchet MS, Arial, Helvetica, sans-serif' color='white' size='+2'>You may also like these...</td></tr>";
				 $arrNames=$_SESSION['relatedItemNames'];
				  $arrMids=$_SESSION['relatedMids'];
				 for($i=0;$i<$_SESSION['relatedItemCount'];$i++)
				 {
					 echo "<tr><td align='center' width='50'><p><a href='prepareSearchGraphs.php?mid=".$arrMids[$i]."&&txtSearch=".$arrNames[$i]."&&idOfKeyword=-1'><font face='Trebuchet MS, Arial, Helvetica, sans-serif' color='white' size='4'>".$arrNames[$i]."</a></p></td>";
					 echo "<td align='left' width='250'><img src='reports/".$_SESSION['userId']."r".$i.".png'"."/></td></tr>";
				 }
			   }
			   else if($_SESSION['sentimentAvailable']==0)
			   {
				   
				   echo "<tr><td align='center'><p><font face='Trebuchet MS, Arial, Helvetica, sans-serif' color='pink' size='45'>but...</font></p></td></tr>
				   <tr><td align='center'><p><font face='Trebuchet MS, Arial, Helvetica, sans-serif' color='gray' size='4'>currently, we are not able produce a report about it :(</font></p></td></tr>
				   <tr><td align='center'><p><font face='Trebuchet MS, Arial, Helvetica, sans-serif' color='white' size='4'>would you like us to send the report to your email when its ready? </font></p><p><font face='verdana' color='white' size='2'>(note: we also hate spam!)</font></p></td></tr>
				   <tr><td><form method='post' action='search.php?sendReport=1'><tr><td align='center'><font face='verdana' color='white' size='2'>email: </font><input size='25' name='email'><input type=submit name='send' value='send me the report later'></td></tr> </form>";
			   }
			    //her kosuşlda related rss leri göster
			   echo   "<tr><td colspan='2' align='center' width='500'><p><font face='Trebuchet MS, Arial, Helvetica, sans-serif' color='white' size='+2'>Check the latest news about ".$_SESSION['txtSearch']."!</td></tr>";
			  echo "<tr><td align='center' colspan='2'>";
			
			  require_once 'rss_fetch.inc';
		$str=str_replace('#','',$_SESSION['txtSearch'],$cnt);
	
			$url = "http://news.google.com/news?q=%22".$str."%22&output=rss";
			$rss = fetch_rss($url);
			
			foreach ($rss->items as $item ) 
			{
				$title = $item[title];
				$url   = $item[link];
				echo "<a href=$url>$title</a></li><br>";
			}
			  
			  echo "</td></tr>";
			   ?>
                </table>
      
      </td></tr></table>
    	  
                    </div>         
                </div>
                 <div id="spacer"></div>
				<br class="clearBoth">
             <div align="left" id="socialMedia"> 			
			<a href="http://twitter.com/thesentana"><img src="design_files/twitter_share.jpg" title="Follow Sentana" alt="Dil Cambaz�" width="40" height="40" /></a>
			<iframe src="http://www.facebook.com/plugins/like.php?href&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=dark&amp;font&amp;height=21&amp;appId=126789240746721" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
	<p>
			<!-- Place this tag where you want the +1 button to render -->
			<g:plusone></g:plusone>

			<!-- Place this render call where appropriate -->
			<script type="text/javascript">
			  (function() {
				var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
				po.src = 'https://apis.google.com/js/plusone.js';
				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
			  })();
			</script>
				
            </div>	
	</div></body></html>